<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('classId');
            $table->string('name');
            $table->string('no');
            $table->integer('total')->default(0);
            $table->string('brand');
            $table->float('inputPrice');
            $table->float('outputPrice');
            $table->string('provider');
            $table->string('discount');
            $table->integer('storeId')->unsigned();
            $table->string('bPic')->nullable();
            $table->timestamps();
            $table->foreign('storeId')->references('id')->on('good_stores');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('goods');
    }
}
